package com.meihua.shellapp.adapter.personalcenter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.meihua.shellapp.R;

import java.util.List;

/**
 * 作者：lc on 2017/9/26.
 * 邮箱：lc0607live@163.com
 */

public class SetUpAdapter extends BaseAdapter {

    private List<String> mDataStr;//显示字
    private Context mContext;

    public SetUpAdapter(Context context, List<String> l_dataStr) {
        mDataStr = l_dataStr;
        mContext = context;
    }

    @Override
    public int getCount() {
        return mDataStr == null ? 0 : mDataStr.size();
    }

    @Override
    public Object getItem(int i) {
        return null;
    }

    @Override
    public long getItemId(int i) {
        return 0;
    }

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {
        ViewHolder holder;
        if (view == null) {
            holder = new ViewHolder();
            view = LayoutInflater.from(mContext).inflate(R.layout.item_setup, null);
            holder.tv_item_setup = view.findViewById(R.id.tv_item_setup);
        } else {
            holder = (ViewHolder) view.getTag();
        }
        holder.tv_item_setup.setText(mDataStr.get(i));
        return view;
    }

    class ViewHolder {
        TextView tv_item_setup;//设置中的板块显示字
    }
}
